package com.testing.class14;

import com.testing.inter.InterKeyWord;

/**
 * @Classname KwToken
 * @Description 类型说明
 * @Date 2022/11/4 22:44
 * @Created by 特斯汀Roy
 */
public class KwToken {
    public static void main(String[] args) {
        InterKeyWord inter=new InterKeyWord();
        inter.saveParam("url","http://www.testingedu.com.cn:8081/inter/HTTP");
        inter.testPostUrl("{url}/auth","");
        //先存到参数paramMap里面。
        inter.saveJsonParam("tokenValue","$.token");
        inter.addHeader("{\"token\":\"{tokenValue}\",\"roy\":\"handsome\"}");

        inter.saveDateParam("用户名","roy","mmss");

        inter.testPostUrl("{url}/register?username={用户名}&pwd=123456&nickname=aka柔弱&describe=肉一老师","");
        inter.assertJsonContainsValue("$.msg","成功");

        inter.testPostUrl("{url}/login","username={用户名}&password=123456");
        inter.saveJsonParam("idValue","$.userid");

        inter.addHeader("{\"will\":\"handsome\"}");

        inter.testPostUrl("{url}/getUserInfo","id={idValue}");
        inter.assertJsonContainsValue("$.msg","成功");



    }
}
